<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/ukkepuk/source/php/classes/model/AbstractEntity.php'); 

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Sleep
 *
 * @author virtual
 */
class Sleep extends AbstractEntity {
    private $id;
    private $kidsId;
    private $sleepFrom;
    private $sleepTo;
    
    public function getId() {  return $this->id;    }
    public function getKidsId() {  return $this->kidsId;    }
    public function getSleepFrom() {  return $this->sleepFrom;    }
    public function getSleepTo() {  return $this->sleepTo;    }
    
    public function setId($id) { $this->id = $id; }
    public function setKidsId($kidsId) { $this->kidsId = $kidsId; }
    public function setSleepFrom($sleepFrom) { $this->sleepFrom = $sleepFrom; }
    public function setSleepTo($sleepTo) { $this->sleepTo = $sleepTo; }    
    
    public function getSleepToTimestampString(){
        return CalendarUtils::transformDateToTimestamp($this->sleepTo);
    }
    
    public function getSleepFromTimestampString(){
        return CalendarUtils::transformDateToTimestamp($this->sleepFrom);
    }
    
    public function setTimeTo($time) {
        $this->sleepTo = CalendarUtils::createDateFromTime($time);
    }
    
    public function setTimeFrom($time) {
        $this->sleepFrom = CalendarUtils::createDateFromTime($time);
    }
    
    public function getTimeFrom() {
        return CalendarUtils::transformDateToTime($this->sleepFrom);
    }
    
    public function getTimeTo() {
        return CalendarUtils::transformDateToTime($this->sleepTo);
    }
    
    public function getBegin(){
        return $this->booleanToYesNo($this->sleepTo == null);
    }
}

?>
